import request from "@/utils/request";

// 查询所有图书信息(传入参数 integer pageNum   integer pageSize  String searchByName 
//返回 list<Book>)
export function getAllBook(data) {
    return request({
      url: 'bookManage/searchBook',
      method: 'post',
      data:data
    })
  }
//添加图书接口
export function addBook(data){
  return request({
    url:'bookManage/addBook',
    method:'post',
    data:data
  })
}



//出版社字或者语言典查询接口
export function getPublishAndLanguageDict(data){
  return request({
    url:'bookManage/selectPublishAndLanguageDict',
    method:'post',
    data
  })
}


//添加出版社或者是语言接口
export function addPublishAndLanguageDict(data){
  return request({
    url:'bookManage/insertPublishAndLanguageDict',
    method:'post',
    data
  })
}

//删除书籍
export function delBook(data){
  return request({
    url:'bookManage/deleteBook',
    method:'delete',
    data
  })
}

//修改书籍信息
export function editBook(data){
  return request({
    url:'bookManage/updateBook',
    method:'post',
    data
  })
}

// test

//查询字典("category","publish","language","author")
export function getDict(data){
  return request({
    url:'bookManage/selectBookAuthor',
    method:'post',
    data
  })
}

//添加字典({
//     "type": "language",
//     "value": [
//         "人名教育出版社",
//         "绍兴出版社"
//     ]
// })
export function addDict(data){
  return request({
    url:'bookManage/addBookAuthor',
    method:'post',
    data
  })
}
//对作者和出版社模糊查询
export function searchDict(data){
  return request({
    url:'bookManage/selectAuthorAndPublishDict',
    method:'post',
    data
  })
}

